package com.quanyan.platform.model.resp;

import com.quanyan.club.entity.RespPlaceClubInfo;
import com.quanyan.club.entity.vo.resp.RespSearchActivity;

import java.io.Serializable;
import java.util.List;

/**
 * Created by slong.guo on 2017/3/15.
 */
public class GatherActivityMatchRecommend implements Serializable {
    private static final long serialVersionUID = -4472598426990599392L;

    private String AC_activityName;
    private Integer AC_activityID;
    private List<String> AC_tags;
    private Long AC_activityTime;
    private Long AC_curTime;
    private Integer AC_pricePerCapita;
    private String AC_caption;
    private String AC_imageUrl;
    private String AC_addr;
    private Integer AC_distance;
    private String AC_activityDetail;

    public GatherActivityMatchRecommend() {
    }

    public GatherActivityMatchRecommend(RespSearchActivity rsa) {
        this.AC_activityName = rsa.getActivityName();
        this.AC_activityID = Integer.valueOf(rsa.getActivityId());
        if (rsa.getActivityStartTime() != null) {
            this.AC_activityTime = rsa.getActivityStartTime().getTime();
        }

        this.AC_curTime = System.currentTimeMillis();
        if (rsa.getActivityPrice() != null) {
            this.AC_pricePerCapita = rsa.getActivityPrice().intValue();
        }
        this.AC_caption = rsa.getActivityDetail();
        this.AC_imageUrl = rsa.getActivityUrl();
        this.AC_addr = rsa.getPlaceAddress();
        this.AC_distance = rsa.getActivityDist().intValue();
        this.AC_activityDetail = rsa.getActivityDetail();

    }

    public GatherActivityMatchRecommend(RespPlaceClubInfo rpci) {
        if (rpci.getActivityName() != null) {
            this.AC_activityName = rpci.getActivityName();
        }

        if (rpci.getActivityId() != null) {
            this.AC_activityID = rpci.getActivityId();
        }

        if (rpci.getStartTime() != null) {
            this.AC_activityTime = rpci.getStartTime().getTime();
        } else {
            this.AC_activityTime = System.currentTimeMillis();
        }
        this.AC_curTime = System.currentTimeMillis();
        if (rpci.getLowestPrice() != null) {
            this.AC_pricePerCapita = rpci.getLowestPrice().intValue();
        } else {
            this.AC_pricePerCapita = 0;
        }

        if (rpci.getActivityDetail() != null) {
            this.AC_caption = rpci.getActivityDetail();
        }

        if (rpci.getClubLogo() != null) {
            this.AC_imageUrl = rpci.getClubLogo();
        }

        //TODO
        this.AC_addr = "";
        this.AC_distance = 0;

    }

    public GatherActivityMatchRecommend(String AC_activityName,
                                        Integer AC_activityID,
                                        List<String> AC_tags,
                                        Long AC_activityTime,
                                        Long AC_curTime,
                                        Integer AC_pricePerCapita,
                                        String AC_caption,
                                        String AC_imageUrl,
                                        String AC_addr,
                                        Integer AC_distance) {
        this.AC_activityName = AC_activityName;
        this.AC_activityID = AC_activityID;
        this.AC_tags = AC_tags;
        this.AC_activityTime = AC_activityTime;
        this.AC_curTime = AC_curTime;
        this.AC_pricePerCapita = AC_pricePerCapita;
        this.AC_caption = AC_caption;
        this.AC_imageUrl = AC_imageUrl;
        this.AC_addr = AC_addr;
        this.AC_distance = AC_distance;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public boolean isValid() {
        return this.AC_activityName != null && this.AC_activityID != null;
//                && this.AC_activityTime != null && this.AC_pricePerCapita != null
//                && this.AC_caption != null && this.AC_imageUrl != null && this.AC_addr != null
//                && this.AC_distance != null;

    }

    public String getAC_activityName() {
        return AC_activityName;
    }

    public void setAC_activityName(String AC_activityName) {
        this.AC_activityName = AC_activityName;
    }

    public Integer getAC_activityID() {
        return AC_activityID;
    }

    public void setAC_activityID(Integer AC_activityID) {
        this.AC_activityID = AC_activityID;
    }

    public List<String> getAC_tags() {
        return AC_tags;
    }

    public void setAC_tags(List<String> AC_tags) {
        this.AC_tags = AC_tags;
    }

    public Long getAC_activityTime() {
        return AC_activityTime;
    }

    public void setAC_activityTime(Long AC_activityTime) {
        this.AC_activityTime = AC_activityTime;
    }

    public Long getAC_curTime() {
        return AC_curTime;
    }

    public void setAC_curTime(Long AC_curTime) {
        this.AC_curTime = AC_curTime;
    }

    public Integer getAC_pricePerCapita() {
        return AC_pricePerCapita;
    }

    public void setAC_pricePerCapita(Integer AC_pricePerCapita) {
        this.AC_pricePerCapita = AC_pricePerCapita;
    }

    public String getAC_caption() {
        return AC_caption;
    }

    public void setAC_caption(String AC_caption) {
        this.AC_caption = AC_caption;
    }

    public String getAC_imageUrl() {
        return AC_imageUrl;
    }

    public void setAC_imageUrl(String AC_imageUrl) {
        this.AC_imageUrl = AC_imageUrl;
    }

    public String getAC_addr() {
        return AC_addr;
    }

    public void setAC_addr(String AC_addr) {
        this.AC_addr = AC_addr;
    }

    public Integer getAC_distance() {
        return AC_distance;
    }

    public void setAC_distance(Integer AC_distance) {
        this.AC_distance = AC_distance;
    }

    public String getAC_activityDetail() {
        return AC_activityDetail;
    }

    public void setAC_activityDetail(String AC_activityDetail) {
        this.AC_activityDetail = AC_activityDetail;
    }
}
